﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Windows;
using System.Windows.Controls;

namespace QLInternet.Model
{
    class util
    {
        public String GetSelectedCells(object sender, RoutedEventArgs e, DataGrid grid)
        {
            string selectedData = "";
            foreach (var dataGridCellInfo in grid.SelectedCells)
            {
                PropertyInfo pi = dataGridCellInfo.Item.GetType().GetProperty(dataGridCellInfo.Column.Header.ToString());
                var value = pi.GetValue(dataGridCellInfo.Item, null);
                selectedData += dataGridCellInfo.Column.Header + ": " + value.ToString() + "\n";
            }
            return selectedData;
        }
       
    }
}
